// ���ϸ� : MemberTestServlet.java
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class MemberTestServlet extends HttpServlet {
	protected void doGet(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		String str = null;
		int number = 0;
		str = req.getParameter("sendmessage");
		res.setContentType("text/html; charset=utf-8");
		PrintWriter out = res.getWriter();
		out.println("<html><head><title>MultiThread Test</title></head>");
		out.println("<body><h2>처리결과(멤버변수)</h2>");
		while (number++ < 10) {
			String strnum = "[" + number + "]";
			out.println("MultiThreadTest : " + str + "  " + strnum + "<br>");
			out.flush();
			System.out.println("MultiThreadTest : " + req.getRemoteHost()
					+ " : " + str + "  " + strnum);
			try {
				Thread.sleep(1000);
			} catch (Exception e) {
				System.out.println(e);
			}
		}
		out.println("<h2>Done " + str + " !!</h2>");
		out.println("</body></html>");
		out.close();
	}
}
